package br.com.sitran.util;



import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;


public class JPAUtil {
	
	private static JPAUtil me;
    private EntityManagerFactory emf;

    private JPAUtil() {
        emf = Persistence.createEntityManagerFactory("UnidadePersistenciaSitran");
    }

    public static JPAUtil getInstance(){
        if(me == null){
            me = new JPAUtil();
        }
        return me;

    }
    
    public  EntityManager getEntityManager(){
        EntityManager retorno = emf.createEntityManager();
        return retorno;

    }
    
   

	
}
